From: Keir Fraser Date: Mon, 9 Jun 2008 08:36:07 +0000 (+0100) Subject: xm on xenapi: Enable more platform configurations X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14200^2~91 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=b630504504130afd8fa05e79a0ccd393e68fbf54;p=xen.git xm on xenapi: Enable more platform configurations Signed-off-by: Yosuke Iwamatsu --- diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py index 1333950190..1a341620b6 100644 --- a/tools/python/xen/xm/xenapi_create.py +++ b/tools/python/xen/xm/xenapi_create.py @@ -821,17 +821,43 @@ class sxp2xml: def extract_platform(self, image, document): - platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode', - 'hap', 'hpet'] - - def extract_platform_key(key): - platform = document.createElement("platform") - platform.attributes["key"] = key - platform.attributes["value"] \ - = str(get_child_by_name(image, key, "1")) - return platform - - return map(extract_platform_key, platform_keys) + + platform_keys = [ + 'acpi', + 'apic', + 'boot', + 'device_model', + 'loader', + 'fda', + 'fdb', + 'keymap', + 'isa', + 'localtime', + 'monitor', + 'pae', + 'rtc_timeoffset', + 'serial', + 'soundhw', + 'stdvga', + 'usb', + 'usbdevice', + 'hpet', + 'timer_mode', + 'vhpt', + 'guest_os_type', + 'hap', + ] + + platform_configs = [] + for key in platform_keys: + value = get_child_by_name(image, key, None) + if value is not None: + platform = document.createElement("platform") + platform.attributes["key"] = key + platform.attributes["value"] = str(value) + platform_configs.append(platform) + + return platform_configs def getFreshEthDevice(self): self._eths += 1